<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<th:block th:include="include :: header('员工手机入职')" />
<th:block th:include="include :: bootstrap-table-css" />
</head>
<!-- BEGIN Body -->
<!-- Possible Classes

		* 'header-function-fixed'         - header is in a fixed at all times
		* 'nav-function-fixed'            - left panel is fixed
		* 'nav-function-minify'			  - skew nav to maximize space
		* 'nav-function-hidden'           - roll mouse on edge to reveal
		* 'nav-function-top'              - relocate left pane to top
		* 'mod-main-boxed'                - encapsulates to a container
		* 'nav-mobile-push'               - content pushed on menu reveal
		* 'nav-mobile-no-overlay'         - removes mesh on menu reveal
		* 'nav-mobile-slide-out'          - content overlaps menu
		* 'mod-bigger-font'               - content fonts are bigger for readability
		* 'mod-high-contrast'             - 4.5:1 text contrast ratio
		* 'mod-color-blind'               - color vision deficiency
		* 'mod-pace-custom'               - preloader will be inside content
		* 'mod-clean-page-bg'             - adds more whitespace
		* 'mod-hide-nav-icons'            - invisible navigation icons
		* 'mod-disable-animation'         - disables css based animations
		* 'mod-hide-info-card'            - hides info card from left panel
		* 'mod-lean-subheader'            - distinguished page header
		* 'mod-nav-link'                  - clear breakdown of nav links

		>>> more settings are described inside documentation page >>>
	-->
<body class="mod-bg-1 mod-nav-link nav-function-minify">
	<!-- DOC: script to save and load page settings -->
	
	<script>
		/**
		 *	This script should be placed right after the body tag for fast execution 
		 *	Note: the script is written in pure javascript and does not depend on thirdparty library
		 **/
		'use strict';

		var classHolder = document.getElementsByTagName("BODY")[0],
		/** 
		 * Load from localstorage
		 **/
		themeSettings = (localStorage.getItem('themeSettings')) ? JSON
				.parse(localStorage.getItem('themeSettings')) : {}, themeURL = themeSettings.themeURL
				|| '', themeOptions = themeSettings.themeOptions || '';
		/** 
		 * Load theme options
		 **/
		if (themeSettings.themeOptions) {
			classHolder.className = themeSettings.themeOptions;
			console.log("%c✔ Theme settings loaded", "color: #148f32");
		} else {
			console
					.log(
							"%c✔ Heads up! Theme settings is empty or does not exist, loading default settings...",
							"color: #ed1c24");
		}
		if (themeSettings.themeURL && !document.getElementById('mytheme')) {
			var cssfile = document.createElement('link');
			cssfile.id = 'mytheme';
			cssfile.rel = 'stylesheet';
			cssfile.href = themeURL;
			document.getElementsByTagName('head')[0].appendChild(cssfile);

		} else if (themeSettings.themeURL && document.getElementById('mytheme')) {
			document.getElementById('mytheme').href = themeSettings.themeURL;
		}
		/** 
		 * Save to localstorage 
		 **/
		var saveSettings = function() {
			themeSettings.themeOptions = String(classHolder.className).split(
					/[^\w-]+/).filter(function(item) {
				return /^(nav|header|footer|mod|display)-/i.test(item);
			}).join(' ');
			if (document.getElementById('mytheme')) {
				themeSettings.themeURL = document.getElementById('mytheme')
						.getAttribute("href");
			}
			;
			localStorage
					.setItem('themeSettings', JSON.stringify(themeSettings));
		}
		/** 
		 * Reset settings
		 **/
		var resetSettings = function() {
			localStorage.setItem("themeSettings", "");
		}
	</script>
	<!-- BEGIN Page Wrapper -->
	<div class="page-wrapper" style="margin:0 auto;overflow-x: auto">
		<div class="page-inner">
			<main id="js-page-content" role="main" class="page-content">
				<div class="subheader">
					<h1 class="subheader-title col-xl-12 col-xs-6"  style="text-align: center;">
						员工手机入职
					</h1>
				</div>
				<div class="row" style="margin:0 auto;overflow:auto">
					<div class="col-xl-12 col-xs-6 col-md-12">
						<div id="panel-1" class="panel">
							<form th:action="@{/system/empentry/update}" method="post" enctype="multipart/form-data">
								<div class="card-body" style="margin:0 auto;min-width:367;">
									<div class="card mb-g border">
										<div class="card-header py-2">
											<div class="card-title">个人信息</div>
										</div>
										<div class="card-body" >
											<div class="form-group ">
										<label class=" col-md-3 col-sm-6">工号： 
											<input type="text" class="form-control"
											id="job_id" name="job_id" th:value="${emp.job_id}"
											readonly="readonly" />
										</label> 
										
										<label class="col-md-3 col-sm-6">员工姓名： 
											<input type="text" class="form-control"
											id="name" name="name" th:value="${emp.name}"
											readonly="readonly" />
										</label> 
										<label class="col-md-3 col-xs-6">出生日期： 
											<input type="date" class="form-control"
											id="birthday" name="birthday"
											th:value="${#dates.format(emp.birthday,'yyyy-MM-dd')}" />
										</label>
									</div>
									<div class="form-group"> 
										<label class="col-md-3 col-xs-6" />身份证号码： <input type="text"
											class="form-control" id="id_card" name="id_card"
											th:value="${emp.id_card}"
											readonly="readonly" /> 
										</label> 
										<label class="col-md-3 col-md-3 col-xs-6" />证件信息： 
											<input type="text" class="form-control" id="cardinfo" name="cardinfo"
											th:value="${(emp.cardinfo=='' || emp.cardinfo==null)?'身份证':emp.cardinfo}" /> 
										</label>
										<label class="col-md-3 col-xs-6">国籍： 
											<input type="text" class="form-control"
											id="nationality" name="nationality"
											th:value="${emp.nationality==''?'中国' :emp.nationality}" />
										</label>
									</div>
									
									<div class="form-group">
										<label class="col-md-4 col-ms-4">移动电话： 
											<input type="text" class="form-control"
											id="ephone" name="ephone" th:value="${emp.ephone}"
											maxlength="11" />
										</label> 
										 <label class="col-md-4 col-xs-4">身份证有效日期：
											<input type="date" class="form-control" id="carddate"
												name="carddate"
												th:value="${#dates.format(emp.carddate,'yyyy-MM-dd')}" />
										</lable>
										
									</div>
									
									<div class="form-group">
										<label class="col-md-4 col-ms-4" >婚否： 
											<input type="text"
												class="form-control" id="ismarry" name="ismarry"
												th:value="${emp.ismarry}" list="ismarrylist" />
											<datalist id="ismarrylist">
												<option value=""></option>
												<option value="已婚" th:text="已婚"></option>
												<option value="未婚" th:text="未婚"></option>
											</datalist>
										</label> 
										<label class="col-md-4 col-ms-4" >性&nbsp;别： <input type="text"
											class="form-control" id="sex" name="sex"
											th:value="${emp.sex}" list="sexlist"/>
											<datalist id="sexlist">
												<option value=""></option>
												<option value="男" th:text="男"></option>
												<option value="女" th:text="女"></option>
											</datalist>
										</label>
									</div>
									<div class="form-group">
										<label class="col-md-3 ms-4" >籍贯： 
											<input type="text"
											class="form-control" id="jiguan" name="jiguan"
											th:value="${emp.jiguan}" /> 
										</label> 
										<label class="col-md-3 ms-4" >身份证地址：
											<input type="text" class="form-control" id="cardaddress"
											name="cardaddress" th:value="${emp.cardaddress}" /> 
										</label> 
										<label
											class="col-md-3 ms-4" >学历： 
											<input type="text"
											class="form-control" id="education" name="education"
											th:value="${emp.education}" list="educationlist" />
											<datalist id="educationlist">
												<option value=""></option>
												<option value="高中" th:text="高中"></option>
												<option value="中专" th:text="中专"></option>
												<option value="大专" th:text="大专"></option>
												<option value="本科" th:text="本科"></option>
												<option value="硕士" th:text="硕士"></option>
												<option value="博士" th:text="博士"></option>
												<option value="博士后" th:text="博士后"></option>
											</datalist>
										</label>
									</div>
									<div class="form-group"> 
										<label class="col-md-3 ms-3" />毕业院校： <input type="text"
											class="form-control" id="school" name="school"
											th:value="${emp.school}" /> 
										</label>
										<label class="col-md-3 ms-3" />专业：
											<input type="text" class="form-control" id="major" name="major"
											th:value="${emp.major}" /> 
										</label>
										<label class="col-md-3 ms-3" >入职前工作时间(月)： 
											<input
											type="text" class="form-control" id="starthiredate"
											name="starthiredate" th:value="${emp.starthiredate}" /> 
										</label>
									</div>
									<div class="form-group">
										<label class="col-md-3 ms-3">居住地址：
											<input type="text"
											class="form-control" id="liveaddress" name="liveaddress"
											th:value="${emp.liveaddress}" /> 
										</label> 
										<label class="col-md-3 ms-3" >户籍地址：
											<input type="text" class="form-control" id="residaddress"
											name="residaddress" th:value="${emp.residaddress}" /> 
										</label>
										<label class="col-md-3 ms-3" >紧急联系人： 
											<input type="text"
											class="form-control" id="connpeop" name="connpeop"
											th:value="${emp.connpeop}" /> 
										</label>
									</div>
									<div class="form-group">
										<label class="col-md-3 ms-3" >家庭电话：
											<input type="text" class="form-control" id="familyphone"
											name="familyphone" th:value="${emp.familyphone}"
											maxlength="11" /> 
										</label> 
										<label class="col-md-3 ms-3" >预计离职时间： 
											<input type="date"
											class="form-control" id="estimatedtime" name="estimatedtime"
											th:value="${emp.estimatedtime}" /> 
										</label>
										<label class="form-group">
											<a th:if="${emp.empphoto}"
											th:href="@{/system/emp/download(filename=${emp.empphoto})}">下载照片
											</a>
											<label th:if="!${emp.empphoto}">照片</label>
											<input type="file" name="empphoto1" id="doc"
												multiple="multiple" class="form-control-file"
												onchange="javascript:setImagePreviews();" accept="image/*" />
											<div id="dd" style="width: 100px;overflow:auto;"></div>
										</label>
									</div>
	
									<div class="form-group">
										<label class="col-md-3 ms-3">
											<a th:if="${emp.Befoleavefile}"
												th:href="@{/system/empentry/download(filename=${emp.Befoleavefile})}">下载原公司离职文件
											</a>
											
											<label th:if="!${emp.Befoleavefile}">原公司离职文件</label>
											<input type="file" id="example-fileinput"
												name="Befoleavefile1" class="form-control-file">
										</label>
										<label class="col-md-3 ms-3">
											<a th:if="${emp.academiccer}"
												th:href="@{/system/empentry/download(filename=${emp.academiccer})}">下载学历证书
											</a>
											
											<label th:if="!${emp.academiccer}">学历证书</label>
											<input type="file" id="example-fileinput" name="academiccer1"
												class="form-control-file">
										</label>
										<label class="col-md-3 ms-3">
											<a th:if="${emp.procer}"
												th:href="@{/system/empentry/download(filename=${emp.procer})}">下载职称证书</a>
											<label th:if="!${emp.procer}">职称证书</label>
											<input type="file" id="example-fileinput" name="procer1"
												class="form-control-file">
										</label>
									</div>
	
									<div class="form-group">
										<label class="col-md-3 ms-3">
											<a th:if="${emp.copyfile}"
												th:href="@{/system/empentry/download(filename=${emp.copyfile})}">下载学生证复印件</a>
											<label th:if="!${emp.copyfile}">学生证复印件</label>
											<input type="file" id="copyfile" name="copyfile1"
												class="form-control-file">
										</label>
										
										<label class="col-md-3 ms-3">
											<a th:if="${emp.laborhand}"
												th:href="@{/system/empentry/download(filename=${emp.laborhand})}">下载劳动手册</a>
											<label th:if="!${emp.laborhand}">劳动手册</label>
											<input type="file" id="laborhand" name="laborhand1"
												class="form-control-file">
										</label>
										<label class="col-md-3 ms-3">
											<a th:if="${emp.mereport}"
												th:href="@{/system/empentry/download(filename=${emp.mereport})}">下载体验报告</a>
											<label th:if="!${emp.mereport}">体验报告</label>
											<input type="file" id="mereport" name="mereport1"
												class="form-control-file">
										</label>
									</div>
									<div class="form-group">
										<label class="col-md-3 ms-3">
											<a th:if="${emp.sopaytcer}"
												th:href="@{/system/empentry/download(filename=${emp.sopaytcer})}">下载社保缴纳证明</a>
											<label th:if="!${emp.sopaytcer}">社保缴纳证明</label>
											<input type="file" id="sopaytcer" name="sopaytcer1"
												class="form-control-file">
										</label>
										
										<label class="col-md-3 ms-3">
											<a th:if="${emp.recordpro}"
												th:href="@{/system/empentry/download(filename=${emp.recordpro})}">下载无犯罪记录证明</a>
											<label th:if="!${emp.recordpro}">无犯罪记录证明</label>
											<input type="file" id="recordpro" name="recordpro1"
												class="form-control-file">
										</label>
										<label class="col-md-3 ms-3">
											<a th:if="${emp.cardpicture}"
												th:href="@{/system/empentry/download(filename=${emp.cardpicture})}">下载身份证照片(正面)</a>
											<label th:if="!${emp.cardpicture}">身份证(正面)</label>
											<input type="file" id="cardpicture" name="cardpicture1"
												class="form-control-file">
										</label>
									</div>
									<div class="form-group">
										<label class="col-md-3 ms-3">
											<a th:if="${emp.card}"
												th:href="@{/system/empentry/download(filename=${emp.card})}">下载身份证(反面)</a>
											<label th:if="!${emp.card}">身份证(反面)</label>
											<input type="file" id="card" name="card1"
												class="form-control-file">
										</label>
										<label class="col-md-3 ms-3">
											<a th:if="${emp.banknum}"
												th:href="@{/system/empentry/download(filename=${emp.banknum})}">下载银行卡数字面</a>
											<label th:if="!${emp.banknum}">银行卡数字面</label>
											<input type="file" id="banknum" name="banknum1"
												class="form-control-file">
										</label>
										<label class="col-md-3 ms-3">
											<a th:if="${emp.leavefile}"
												th:href="@{/system/emp/download(filename=${emp.leavefile})}">下载离职文件</a>
											<label th:if="!${emp.leavefile}">离职文件</label>
											<input type="file" id="leavefile" name="leavefile1"
												class="form-control-file">
										</label>
									</div>
									<div class="form-group">
										<label class="col-md-3 ms-3">
											<a th:if="${emp.laborcontract}"
												th:href="@{/system/emp/download(filename=${emp.laborcontract})}">下载劳动合同</a>
											<label th:if="!${emp.laborcontract}">劳动合同</label>
											<input type="file" id="laborcontract" name="laborcontract1"
												class="form-control-file">
										</label>
										<label class="col-md-3 ms-3">
											<a th:if="${emp.otherdata}"
												th:href="@{/system/empentry/download(filename=${emp.otherdata})}">下载其它资料</a>
											<label th:if="!${emp.otherdata}">其它资料</label>
											<input type="file" id="otherdata" name="otherdata1"
												class="form-control-file">
										</label>
									</div>
									<div style="margin: 0 auto; text-align: center">
										<button
											class="btn buttons-selected btn-primary btn-sm mr-1 disabled"
											tabindex="0" aria-controls="dt-basic-example" type="submit"
											style="width: 100px; height: 30px" id="saveMessage">
											<span><i class="fal fa-edit mr-8"></i> 保存</span>
										</button>
										<div>&nbsp;</div>
									</div>
								</div>
							</form>
						</div>
					</div>
				</div>
			</div>
		</main>
	<th:block th:include="include :: footer" />
	<th:block th:include="include :: bootstrap-table-js" />
	<script th:inline="javascript">
		var loginName = [ [ common ] ]
	</script>
	<script>
		$(function() {
			if (loginName != "admin") {
				getRemind();
				self.setInterval("getRemind()", 1000 * 10);
			}
		})

		//获取我的提醒
		function getRemind() {
			$
					.ajax({
						url : ctx + 'system/remind/getRemindListNoPaging',//地址
						success : function(data, status) {
							//alert(data);
							if (status == 'success') {

								$("#remindList").empty();
								if (data.length > 0) {
									$("#remindTotal_1").text(data.length);
									$("#remindTotal_2").text(data.length);
								} else if (data.length == 0) {
									$("#remindTotal_1").text('');
									$("#remindTotal_2").text('');
								}
								for (var i = 0; i < data.length; i++) {
									var obj = data[i];
									var offset = transDate(obj.remindDate)
									var url = ctx + "system/remind?id="
											+ obj.id;
									$("#remindList")
											.append(
													"<li class=\"unread\"><a href="+url+" class=\"d-flex align-items-center\"> <span class=\"d-flex flex-column flex-1 ml-1\"> <span class=\"name\">"
															+ obj.formName
															+ "</span> <span class=\"msg-a fs-sm\">"
															+ obj.remindContent
															+ "</span> <span class=\"fs-nano text-muted mt-1\">"
															+ offset
															+ "</span></span></a></li>");
								}
							}
						}
					})
		}

		// 计算耗时
		function transDate(todoTime) {
			date = new Date(todoTime);
			var tt = date;
			var days = parseInt((new Date().getTime() - date) / 86400000);
			var today = new Date().getDate();
			var year = tt.getFullYear();
			var mouth = tt.getMonth() + 1;
			var day = tt.getDate();
			var time = tt.getHours() < 10 ? "0" + tt.getHours() : tt.getHours();
			var min = tt.getMinutes() < 10 ? "0" + tt.getMinutes() : tt
					.getMinutes();
			var result, offset;
			offset = Math.abs(today - day);
			if (days < 4 && offset < 4) {
				if (offset === 0) {
					result = "今天" + time + ":" + min;
				} else if (offset === 1) {
					result = "昨天" + time + ":" + min;
				} else if (offset === 2) {
					result = "前天" + time + ":" + min;
				} else if (offset === 3) {
					result = "3天前" + time + ":" + min;
				}
			} else {
				// result = year + "-" + mouth + "-" + day + " " + time + ":" + min;
				result = "3天以前";
			}
			return result;
		}
	</script>
	<script type="text/javascript">

    //下面用于多图片上传预览功能
    function setImagePreviews(avalue) {
        //获取选择图片的对象
        var docObj = document.getElementById("doc");
        //后期显示图片区域的对象
        var dd = document.getElementById("dd");
        dd.innerHTML = "";
        //得到所有的图片文件
        var fileList = docObj.files;
        //循环遍历
        for (var i = 0; i < fileList.length; i++) {    
            //动态添加html元素        
            dd.innerHTML += "<div style='float:left' > <img id='img" + i + "'  /> </div>";
            //获取图片imgi的对象
            var imgObjPreview = document.getElementById("img"+i); 
            
            if (docObj.files && docObj.files[i]) {
                //火狐下，直接设img属性
                imgObjPreview.style.display = 'block';
                imgObjPreview.style.width = '200px';
                imgObjPreview.style.height = '180px';
                //imgObjPreview.src = docObj.files[0].getAsDataURL();
                //火狐7以上版本不能用上面的getAsDataURL()方式获取，需要以下方式
                imgObjPreview.src = window.URL.createObjectURL(docObj.files[i]);   //获取上传图片文件的物理路径
            }
            else {
                //IE下，使用滤镜
                docObj.select();
                var imgSrc = document.selection.createRange().text;
                //alert(imgSrc)
                var localImagId = document.getElementById("img" + i);
               //必须设置初始大小
                localImagId.style.width = "200px";
                localImagId.style.height = "180px";
                //图片异常的捕捉，防止用户修改后缀来伪造图片
                try {
                    localImagId.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale)";
                    localImagId.filters.item("DXImageTransform.Microsoft.AlphaImageLoader").src = imgSrc;
                }
                catch (e) {
                    alert("您上传的图片格式不正确，请重新选择!");
                    return false;
                }
                imgObjPreview.style.display = 'none';
                document.selection.empty();
            }
        }  
        return true;
    }

</script>
</body>
<!-- END Body -->
</html>
